local hx__longqi = fk.CreateSkill{
    name = "hx__longqi",

    tags = {},
}

hx__longqi:addEffect(fk.DamageCaused,{
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(hx__longqi.name) and target and target == player and player.hp > 0
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local suc,dat = room:askToUseActiveSkill(player,{skill_name = "#hx__longqi_active", cancelable = true, prompt = "#hx__longqi__damage::"..data.to.id,})
    if suc and dat then
        event:setCostData(self,dat.interaction)
        return true
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local num = tonumber(event:getCostData(self))
    if not num then return end
    room:loseHp(player,num,hx__longqi.name)
    data:changeDamage(num)
  end,
})

return hx__longqi